﻿@model Aurora.WebApp.ViewModel.Employee.ListTrabajadoresViewModel
@{
    ViewBag.Title = "Lista de Empleados";
}

<div class="panel-group" id="accordion-example">
    <div class="panel">
        <div class="panel-heading">
            <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion-example" href="#collapseOne">
                <i class="fa fa-filter"></i> &nbsp;&nbsp;Filtro
            </a>
        </div>
        <div id="collapseOne" class="panel-collapse collapse" style="height: 0px;">
            <div class="panel-body">
                <form method="post" class="form-horizontal">
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="form-group no-margin-hr">
                                <label class="control-label">Nombres y/o Apellidos</label>
                                @Html.TextBoxFor(x => x.TRA_NOMBRE, new { @class = "form-control" })
                            </div>
                        </div><!-- col-sm-6 -->
                        <div class="col-sm-6">
                            <div class="form-group no-margin-hr">
                                <label class="control-label">Código</label>
                                @Html.TextBoxFor(x => x.TRA_CODIGO, new { @class = "form-control" })
                            </div>
                        </div><!-- col-sm-6 -->
                    </div><!-- row -->
                    <div class="panel-footer text-right">
                        <button class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;&nbsp;Buscar</button>
                    </div>
                </form>
            </div>

        </div>
    </div>
</div>
<div class="clear-fix"></div>
<div class="table-primary">
    <div class="table-header">
        <div class="table-caption">
            <i class="fa fa-list"></i>&nbsp;&nbsp;Resultados
            <div class="pull-right"><a href="@Url.Action("AddEditTrabajador", "Employee")" class="btn btn-sm btn-default"><i class="fa fa-plus"></i>&nbsp;&nbsp;Agregar Trabajador</a></div>
        </div>
    </div>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th class="col-sm-2 text-center">Código</th>
                <th class="col-sm-4 text-center">Nombres</th>
                <th class="col-sm-2 text-center">DNI</th>
                <th class="col-sm-2 text-center">Rol</th>
                <th class="col-sm-2 text-center">Opciones</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.LstTrabajadores)
            {
                <tr>
                    <td class="text-center">@item.TRA_CODIGO</td>
                    <td>@item.TRA_NOMBRE</td>
                    <td class="text-center">@item.TRA_DNI</td>
                    <td class="text-center">@item.Rol.ROL_NOMBRE</td>
                    <td class="text-center">
                        <a href="@Url.Action("AddEditTrabajador", "Employee", new { TRA_ID = item.TRA_ID })" class="btn btn-sm btn-info"><i class="fa fa-pencil"></i>&nbsp;&nbsp;Editar</a>&nbsp;
                        <a @Data.ModalLink("ConfirmDeleteTrabajador", "Employee", new { TRA_ID = item.TRA_ID }) class="btn btn-sm btn-danger"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;Eliminar</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
@Html.PagedListPager(Model.LstTrabajadores, page => Url.Action("LstTrabajadoresAll", new { np = page, TRA_CODIGO = Model.TRA_CODIGO, TRA_NOMBRE = Model.TRA_NOMBRE }), ConstantHelpers.Bootstrap3Pager)

